var dispatcher = {
	dispatch: function (app, routes) {
		routes.forEach(function (route) {
			app[route.method](route.url, function (req, res, next) {
				route.controller(req, res, next);
			})
		});
	}
};

module.exports = dispatcher;